<template>
  <div id="app">
    <router-view/>
  </div>
</template>
<script>
import _subject from './assets/utils/subject'

export default {
  data() {
    return {
      //全局websocket监听
      wsSub: null
    }
  },
  created() {
    console.log('connect ws')
    this.wsSub = _subject.ws.subscribe({
      next(t) {
        console.log('app ws msg: ', t)
      }
    })
  },
  destroyed() {
    console.log('destroy ws')
    if (this.wsSub) {
      _subject.offline()
      this.wsSub.unsubscribe()
    }
  }
}
</script>
<style lang="scss">
/* 全局样式 */
html,
body,
.homepage {
  // height: 100%;
  /*overflow-y: hidden;*/
}
.clearfix {
  &:after {
    content: '';
    display: block;
    clear: both;
    height: 0;
  }
}
.content-container {
  height: 98%;
  display: flex;
  flex-direction: column;

  .table {
    flex-grow: 1;
  }
}
.flex-box {
  display: flex;
  align-items: center;
  @at-root #{&}-between {
    justify-content: space-between;
  }
  @at-root #{&}-round {
    justify-content: space-around;
  }
}

.margin-r {
  margin-right: 15px;
  margin-right: 15px;
}
.margin-l {
  margin-left: 15px;
}
.text-center {
  text-align: center;
}
i.icon {
  display: block;
  width: 20px;
  height: 20px;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
}
img {
  border: 0;
}
.c-type {
  .el-radio-button {
    margin: 0 10px;
    .el-radio-button__inner {
      border-radius: 4px !important;
      border: 1px solid #ccc;
    }
  }
}
</style>
<style lang="scss">
* {
  padding: 0;
  margin: 0;
}
li {
  list-style: none;
}
a {
  text-decoration: none;
}
#app {
  font-family: 'Arial Normal', 'Arial Negreta', 'Arial';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  color: #2c3e50;
  background-color: #f7f9fc;
}
</style>
